"""数据模型模块"""
from pydantic import BaseModel
from enum import IntEnum

class Period(IntEnum):
    """K线周期枚举"""
    TICK = -1
    M1 = 1
    M3 = 3
    M5 = 5
    M10 = 10
    M15 = 15
    M30 = 30
    H1 = 60
    H2 = 120
    DAY = 0
    WEEK = -7
    MONTH = -30

class TickData(BaseModel):
    """Tick数据模型"""
    code: str
    exchg: str
    price: float
    volume: int
    turnover: float
    open_interest: int
    bid_price: float
    bid_volume: int
    ask_price: float
    ask_volume: int
    time: int

class BarData(BaseModel):
    """K线数据模型"""
    code: str
    exchg: str
    period: int
    open: float
    high: float
    low: float
    close: float
    volume: int
    turnover: float
    open_interest: int
    time: int 